I checked Cairo source code (actually pixman, as Cairo just passes
through) to make sure that the behavior stays identical: negative values
cause an error message from pixman, zero is allowed. Both return an
empty region which gtk_widget_queue_draw_region() would then proceed to
ignore.
* defined as @widget->window coordinates for widgets that are not
* #GTK_NO_WINDOW widgets, and are relative to @widget->allocation.x,
* @widget->allocation.y for widgets that are #GTK_NO_WINDOW widgets.
+ *
+ * @width or @height may be 0, in this case this function does
+ * nothing. Negative values for @width and @height are not allowed.
*/
void
gtk_widget_queue_draw_area (GtkWidget *widget,
cairo_region_t *region;
g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (width >= 0);
+ g_return_if_fail (height >= 0);
+
+ if (width == 0 || height == 0)
+ return;
rect.x = x;
rect.y = y;